package com.zengdada.authority.utils;

/**
 * @Auther: 12614
 * @Contact: 1261438511@qq.com
 * @Date: 2019-02-21 14:39
 * @Description:
 */
public class ExceptionUtil {

    public static String getMessage(Exception e) {
        return e.getMessage();
    }


    public static String getRawMessage(Throwable e) {
        Throwable cause = e.getCause();
        if (cause == null) {
            return e.getMessage();
        } else {
            String rawMessage = getRawMessage(cause);
            return rawMessage == null ? e.getMessage() : rawMessage;
        }
    }
}
